package com.example.controller;

import com.example.entity.authority.UsedPartyDetail;
import com.example.service.UsedPartyDetaiService;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

/**
 * Created by simon on 2017/10/18.
 */
@RestController
@RequestMapping("api/usedDetail")
public class UsedPartyDetaiController {

    @Autowired
    UsedPartyDetaiService usedPartyDetaiService;

    @ApiOperation(value = "查询使用单位详细信息",notes = "查询使用单位详细信息")
    @RequestMapping(value="/queryById/{id}",method = RequestMethod.POST)
    Map<String,Object> queryById(@PathVariable(value = "id") String id) {

        return usedPartyDetaiService.queryById(id);
    }

    @ApiOperation(value = "添加使用单位详细信息",notes = "添加使用单位详细信息")
    @RequestMapping(value="/add",method = RequestMethod.POST)
    Map<String,Object> add(@RequestBody UsedPartyDetail usedPartyDetail) {

        return usedPartyDetaiService.add(usedPartyDetail);
    }

    @ApiOperation(value = "修改使用单位详细信息",notes = "修改使用单位详细信息")
    @RequestMapping(value="/update",method = RequestMethod.POST)
    Map<String,Object> update(@RequestBody UsedPartyDetail usedPartyDetail) {

        return usedPartyDetaiService.update(usedPartyDetail);
    }
}
